package com.letian.record.service.impl;

import java.util.List;
import com.letian.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.letian.record.mapper.RecordAssetMapper;
import com.letian.record.domain.RecordAsset;
import com.letian.record.service.IRecordAssetService;

/**
 * 记录资产Service业务层处理
 * 
 * @author bmz
 * @date 2023-01-15
 */
@Service
public class RecordAssetServiceImpl implements IRecordAssetService 
{
    @Autowired
    private RecordAssetMapper recordAssetMapper;

    /**
     * 查询记录资产
     * 
     * @param assetId 记录资产主键
     * @return 记录资产
     */
    @Override
    public RecordAsset selectRecordAssetByAssetId(Long assetId)
    {
        return recordAssetMapper.selectRecordAssetByAssetId(assetId);
    }

    /**
     * 查询记录资产列表
     * 
     * @param recordAsset 记录资产
     * @return 记录资产
     */
    @Override
    public List<RecordAsset> selectRecordAssetList(RecordAsset recordAsset)
    {
        return recordAssetMapper.selectRecordAssetList(recordAsset);
    }

    /**
     * 新增记录资产
     * 
     * @param recordAsset 记录资产
     * @return 结果
     */
    @Override
    public int insertRecordAsset(RecordAsset recordAsset)
    {
        recordAsset.setCreateTime(DateUtils.getNowDate());
        return recordAssetMapper.insertRecordAsset(recordAsset);
    }

    /**
     * 修改记录资产
     * 
     * @param recordAsset 记录资产
     * @return 结果
     */
    @Override
    public int updateRecordAsset(RecordAsset recordAsset)
    {
        recordAsset.setUpdateTime(DateUtils.getNowDate());
        return recordAssetMapper.updateRecordAsset(recordAsset);
    }

    /**
     * 批量删除记录资产
     * 
     * @param assetIds 需要删除的记录资产主键
     * @return 结果
     */
    @Override
    public int deleteRecordAssetByAssetIds(Long[] assetIds)
    {
        return recordAssetMapper.deleteRecordAssetByAssetIds(assetIds);
    }

    /**
     * 删除记录资产信息
     * 
     * @param assetId 记录资产主键
     * @return 结果
     */
    @Override
    public int deleteRecordAssetByAssetId(Long assetId)
    {
        return recordAssetMapper.deleteRecordAssetByAssetId(assetId);
    }
}
